﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
using Transcend.FileUploader.Entity;
using Transcend.FileUploader.Utility;

namespace Transcend.FileUploader.Dao
{
    /// <summary>
    /// dsitem -> DocCategory 映射类
    /// </summary>
    class DocCategoryMapper : Transcend.DP3.Db.IReaderMapper<DocCategory>
    {
        public DocCategory Map(DbDataReader dr)
        {

       //     ROW_NO,
       //CRED_ID,
       //CRED_NAME,
       //CRED_TYPE,
       //PAGE_COUNT,
       //COPIES,
       //SCAN_NUM,
       //STEP_ID,
       //IS_DOUBLE,
       //KEYWORD,
       //NOTES,
       //ID,
       //INST_ID,
       //CREATE_USER_ID,
       //MODIFY_USER_ID,
       //CREATE_DATE,
       //MODIFY_DATE,
       //DIVISION_ID


            DocCategory page = new DocCategory();
            page.STEP_ID = Transcend.DP3.Db.Database.GetValue<decimal>(dr, "STEP_ID", -1);
            page.Copies = Transcend.DP3.Db.Database.GetValue<int>(dr, "COPIES", -1);
            page.CreateTime = Transcend.DP3.Db.Database.GetValue<DateTime>(dr, "CREATE_DATE");
            page.CredId = Transcend.DP3.Db.Database.GetValue<decimal>(dr, "CRED_ID", -1);
            page.Name = Transcend.DP3.Db.Database.GetValue<string>(dr, "CRED_NAME", string.Empty);
            page.CredType = Transcend.DP3.Db.Database.GetValue<decimal>(dr, "CRED_TYPE", -1);
            page.InstId = Transcend.DP3.Db.Database.GetValue<decimal>(dr, "INST_ID", -1);
            page.IsDouble = Transcend.DP3.Db.Database.GetValue<int>(dr, "IS_DOUBLE", -1);
            page.Id = Transcend.DP3.Db.Database.GetValue<decimal>(dr, "ID", -1);
			//page.Keyword = Transcend.DP3.Db.Database.GetValue<string>(dr, "keyword", string.Empty);
            page.Notes = Transcend.DP3.Db.Database.GetValue<string>(dr, "NOTES", string.Empty);
            page.PageNum = Transcend.DP3.Db.Database.GetValue<int>(dr, "PAGE_COUNT", -1);
			//page.ParentItemId = Transcend.DP3.Db.Database.GetValue<decimal>(dr, "parentitemid", -1);
            page.RowNo = Transcend.DP3.Db.Database.GetValue<int>(dr, "ROW_NO", -1);
            page.ScanNum = Transcend.DP3.Db.Database.GetValue<int>(dr, "SCAN_NUM", -1);
           // page.DIVISION_ID = Transcend.DP3.Db.Database.GetValue<int>(dr, "DIVISION_ID", -1);
            return page;
        }
    }
}
